package com.gesee.zyspps.utils;

import android.app.Activity;
import android.content.Intent;

import com.gesee.zyspps.ZSApplication;

/**
 * 
* @ClassName: IntentUtil
* @Description: TODO(Intent工具类)
* @author fujianxiong
* @date 2015年8月11日 下午9:48:53
*
 */
public class IntentUtil
{

    public static void startActivity(Class<? extends Activity> toActivity)
    {
        Activity fromActivity = ZSApplication.getInstance().getCurrentActivity();
        if (null == fromActivity)
        {
            return;
        }
        Intent intent = new Intent(fromActivity.getApplicationContext(), toActivity);
        fromActivity.startActivity(intent);
    }

    public static void startActivity(Class<? extends Activity> toActivity, Intent src)
    {
        Activity fromActivity = ZSApplication.getInstance().getCurrentActivity();
        if (null == fromActivity)
        {
            return;
        }
        Intent intent = new Intent(fromActivity.getApplicationContext(), toActivity);
        intent.putExtras(src);
        fromActivity.startActivity(intent);
    }
}
